import { defineStore } from 'pinia'
const key = 'address'

// 定义 Store
export const useAddressStore = defineStore('address', {
  state: () => {
    return {
      address: window.localStorage.getItem(key) || ''
    }
  },
  actions: {
    setAddress(val: string) {
      this.address = val
      window.localStorage.setItem(key, val)
    }
  }
})
